//
//  WBHomeCell.swift
//  myWeibo
//
//  Created by 何达达 on 2018/5/28.
//  Copyright © 2018年 hedada. All rights reserved.
//

import UIKit

class WBHomeCell: UITableViewCell {

    @IBOutlet weak var bigImage: UIImageView!
    
    @IBOutlet weak var mainTitle: UILabel!
    
    @IBOutlet weak var iconBtn: UIButton!
    
    @IBOutlet weak var titleLabel: UILabel!
    
    var btnClick : (()->())?
    
    var model : WBHomeModel!
    
    var newModel : WBHomeModel{
        
        set {
            self.model = newValue
            self.mainTitle.text = self.model.mainTitle
            self.titleLabel.text = self.model.title
         //   self.imageView?.image = UIImage(named:self.model.imageName)
        }
        get {
            return self.model
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
      
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }
    
   
    class  func instanceCell() -> WBHomeCell? {
        let nibCell = Bundle.main.loadNibNamed("WBHomeCell", owner: nil, options: nil)
        if  let cell = nibCell?.first as? WBHomeCell{
            return cell
        }
            return nil
    }
    
    @IBAction func myClick(_ sender: Any) {
        if btnClick != nil {

            btnClick!()
        }
        
 
    }
    
   

}
